package com.jsgt.greekfire.dao

import androidx.room.TypeConverter

class DateTypeConverter {
    @TypeConverter
    fun any2String(obj: Any): String {
        return obj.toString()
    }

    @TypeConverter
    fun string2Any(str: String): Any {
        return str
    }

    @TypeConverter
    fun boolean2Int(b: Boolean): Int {
        return if (b) {
            1
        } else {
            0
        }
    }

    @TypeConverter
    fun int2Boolean(i: Int): Boolean {
        return i > 0
    }
}